<?php
class Application_Model_Schema_Queue {
	protected $_id;
	protected $_startTime;
	protected $_endTime;
	protected $_elapsedTime;
	protected $_action;
	protected $_resources = array();
	protected $_objects = array();

	public function __set($name, $value) {
		$method = 'set' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Set Invalid Queue Property: ' . $name);
		}
		$this->$method($value);
	}

	public function __get($name) {
		$method = 'get' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Get Invalid Queue Property: ' . $name);
		}
		return $this->$method();
	}

	public function setId($id) {
		$this->_id = (int) $id;
		return $this;
	}

	public function getId() {
		return $this->_id;
	}

	public function setStartTime($time) {
		$this->_startTime = (int) $time;
		return $this;
	}

	public function getStartTime() {
		return $this->_startTime;
	}

	public function setEndTime($time) {
		$this->_endTime = (int) $time;
		return $this;
	}

	public function getEndTime() {
		return $this->_endTime;
	}

	public function setElapsedTime($time) {
		if($time !== null) {
			$time = (int) $time;
		}
		$this->_elapsedTime = $time;
		return $this;
	}

	public function getElapsedTime() {
		return $this->_elapsedTime;
	}

	public function setAction($action) {
		$this->_action = $action;
		return $this;
	}

	public function getAction() {
		return $this->_action;
	}

	public function setResource($resource, $k = null) {
		if(isset($k)) {
			$this->_resources[$k]	= $resource;
		} else {
			$this->_resources[]		= $resource;
		}

		return $this;
	}

	public function setResources($resources) {
		return $this->_resources = $resources;
	}

	public function getResources() {
		return $this->_resources;
	}

	public function setObject($object, $k = null) {
		if(isset($k)) {
			$this->_objects[$k]	= $object;
		} else {
			$this->_objects[]		= $object;
		}

		return $this;
	}

	public function setObjects($objects) {
		return $this->_objects = $objects;
	}

	public function getObjects() {
		return $this->_objects;
	}
}
?>